package cn.lyvust.work.exam01;

/**
 * Description:
 * date: 2021-5-11 22:35
 *
 * @author Guo_guo
 * @since JDK 1.8
 */
public class T1 {
    public static void main(String[] args) {
        MyThread thread1 = new MyThread();
        MyThread thread2 = new MyThread();
        thread1.start();
        thread2.start();
    }
}
//注意:同一个java源文件里面只能有一个public的类存在，因此Mythread不能为public
class MyThread extends Thread {
    public void run() {
        for (int i = 1; i <= 20; i++) {
            System.out.println(i + ".你好，来自线程"+Thread.currentThread().getName());
        }
    }
}
